home *** CD-ROM | disk | FTP | other *** search
- Path: mayne.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Obtaining file lists in C?
- Date: 16 Apr 1996 13:52:08 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4l119oINN8os@mayne.ugrad.cs.ubc.ca>
- References: <gcraig.1.001653A2@interaccess.com> <4ktll1$bk5@texas.nwlink.com>
- NNTP-Posting-Host: mayne.ugrad.cs.ubc.ca
-
- In article <4ktll1$bk5@texas.nwlink.com>,
- Teresa Reiko <tjr19@mail.nwlink.com> wrote:
- >gcraig@interaccess.com (George Craig) wrote:
- >>Could someone please tell me just one of the many ways I could implement an
- >>efficient file listing technique in standard ANSI or k&R c?
- >
- >This is impossible in standard C. There is no standard C function to
- >read the directories. Most C implementations include one, however, so
- >for instance in Borland C you can use findfirst and findnext, or you
- >can use opendir, readdir, etc.
-
- The latter are preferrable, because they are part of a standard, namely
- POSIX.1. They also have reentrant semantics (more than one directory reading
- stream can be created and stepped simultaneously).
- --
- I'm not really a jerk, but I play one on Usenet.
-